package httpserver

import (
	"fmt"
	"log"
	"net/http"
)

// 处理根路径的 HTTP 请求
func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
}

func Run() {
	// 注册处理函数
	http.HandleFunc("/", handler)
	// 启动 HTTP 服务器，监听 8000 端口
	log.Fatal(http.ListenAndServe(":8000", nil))
}
